package com.pedromassango.delyo.ui.gives

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.pedromassango.delyo.R

val give = arrayListOf<Gives>()
class Givelist : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_givelist)
        initdata()
        val recycler=findViewById<RecyclerView>(R.id.giverecycler)
        recycler.layoutManager= LinearLayoutManager(this)
        recycler.adapter= GiveAdapter(give)
    }

    private fun initdata() {
        for(i in 1..10)
        {

            give.add(Gives().apply {
                givename = "沙拉"
                givedescription = "减肥！！"
                givepicture = R.mipmap.salade
            })

        }
    }
}